package com.hellobike.haxing.modules.order.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
public class ShopStaticsVo implements Serializable {
    @ApiModelProperty("店铺 ID")
    private Long shopId;
    @ApiModelProperty("团长姓名")
    private String realName;
    @ApiModelProperty("归属上一级")
    private String leadUser;
    @ApiModelProperty("上一级手机号")
    private String leadMobile;
    @ApiModelProperty("团长销量")
    private BigDecimal productAmount;
    @ApiModelProperty("一级抽成")
    private BigDecimal shopAmount;
    @ApiModelProperty("团长类型")
    private String shopType;
    @ApiModelProperty("下一级团长数量")
    private Integer shops;
    @ApiModelProperty("下一级销售金额")
    private BigDecimal subProductAmount;
    @ApiModelProperty("二级分佣")
    private BigDecimal subLeaderAmount;
    @ApiModelProperty("总收益")
    private BigDecimal totalAmount;
    @ApiModelProperty("手机号")
    private String mobile;

    public BigDecimal getTotalAmount() {
        if (this.subLeaderAmount == null) {
            this.subLeaderAmount = BigDecimal.ZERO;
        }
        if (this.shopAmount == null) {
            this.shopAmount = BigDecimal.ZERO;
        }
        return this.subLeaderAmount.add(this.shopAmount);
    }
}
